body {
  margin: 0;
  padding: 0;
  color: #222;
  background: var(--w7-surface);
  font: var(--w7-font);
}

#social {
  display: flex;
  justify-content: flex-end;
  margin: 1em 1em -1em;
  gap: 3px;
}

#social > [role="button"] {
  min-width: unset;
  min-height: unset;
  padding: 0.2em 0.5em;
  text-decoration: none;
  color: #000;
  display: flex;
  align-items: center;
}

#social img {
  height: 18px;
  margin-right: 3px;
}

main {
  margin: 0 30px 60px 260px;
  box-sizing: border-box;
}

aside {
  width: 240px;
  position: fixed;
  top: 0;
  bottom: 0;
  padding: 8px;
  z-index: 99;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
}

aside .tree-view {
  width: 100%;
  overflow-y: scroll;
}

h1 {
  font-size: 5rem;
  margin: 12px 0;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.6rem;
}

h4 {
  font-size: 1.5rem;
}

h3,
h4 {
  /* Swap the margin for a top-padding so linking to this section
     results in a better scroll position */
  padding-top: 20px;
  margin-top: 0;
  display: block;
  flex: 0 0 200px;
}

hr {
  margin: 0;
  border: 1px solid #ccc;
  max-width: 400px;
  box-shadow: 0 1px #fff;
}

p {
  max-width: 50rem;
  line-height: 1.5;
}

p code,
ul code {
  background: #e0e0e0;
  padding: 2px 3px;
}

pre {
  display: block;
  margin: 0;
  padding: 12px 8px;
  background: #fff;
  border: 1px solid #8e8f8f;
}

.component {
  display: flex;
  margin-top: 24px;
}

.component li:not([role]) {
  margin-bottom: 8px;
}

blockquote {
  margin: 0 0 20px;
  padding: 20px;
  background: #dfdfdf;
}

blockquote footer {
  margin: 12px 0 0 12px;
}

.example {
  margin: 16px 0;
  padding: 12px 24px;
  border-left: 1px solid #808080;
  width: 100%;
  box-sizing: border-box;
}

.code {
  margin-top: 12px;
}

.code summary {
  text-decoration: underline;
}

.code summary:focus-visible {
  outline: 1px dotted #000;
}

.code > .copy {
  display: block;
  margin-left: auto;
}

.code[open] summary {
  margin-bottom: 8px;
}

.background {
  padding: 1.5em;
  margin: 1.5em 0;
  background-image: url("./flower-aaronburden-unsplash.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

[role="dialog"] {
  width: 450px;
}

[role="tooltip"]:not([id]) {
  margin: 2em 0;
}

@media (max-width: 480px) {
  aside {
    display: none;
  }

  main {
    width: 100%;
    margin: 0;
    padding: 16px;
  }

  hr,
  p {
    width: 100%;
  }

  h3,
  h4 {
    flex: 0;
  }

  .component {
    display: block;
    margin-top: 24px;
  }

  pre {
    overflow-x: scroll;
  }

  [role="dialog"] {
    width: 90%;
  }
}
